package com.xhiji.test.write;

import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * 输入一行字符，分别统计出其中英文字母、空格、数字和其它字符的个数。
 */
public class tongjizifu {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int a=0,b=0,c=0,d=0;
        char[] chars = s.toCharArray();
        for (char ch: chars) {
            if (ch >='0'&&ch<='9'){
                b++;
            }else if ((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')){
                a++;
            }else if (ch ==' '){
                c++;
            }else {
                d++;
            }
        }
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
    }

}
